program ege_b8;
var s:string[200];
    c:char;
    i,n:integer;
begin
s:='';
c:='0';
write('>>> enter number of char to seek: ');
readln(n);
for i:=1 to 10 do begin
	s:=s+s+c;
	inc(c);
	end;
writeln(s[n]);
end.
